import func from './plugins/preload.js'
import nodeWrap from '@/views/workFlow/component/nodeWrap.vue'
Vue.component('nodeWrap', nodeWrap); //初始化组件
import addNode from '@/views/workFlow/component/addNode.vue'
Vue.component('addNode', addNode); //初始化组件
Vue.prototype.$func = func;





import Vue from 'vue';
import axios from './router/axios';
import VueAxios from 'vue-axios';
import App from './App';
import router from './router/router';
import './permission'; // 权限
import './error'; // 日志
import './cache'; //页面缓存
import store from './store';
import {
    loadStyle
} from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
import * as echarts from 'echarts';
import 'echarts-wordcloud';
Vue.prototype.$echarts = echarts
import {
    iconfontUrl,
    iconfontVersion
} from '@/config/env';
import i18n from './lang'; // Internationalization
if (store.state.pageStyle == '1') { //自定义判断页面风格样式 当前1.默认 2.抽屉
    import ('./styles/common.scss');
} else {
    import ('./styles/commonDrawerStyle.scss');
}

import './styles/comm.scss';
import basicBlock from './components/basic-block/main';
import basicContainer from './components/basic-container/main';
import myDrawer from './components/drawer/myDrawer'
import thirdRegister from './components/third-register/main';
import avueUeditor from 'avue-plugin-ueditor';
import website from '@/config/website';
import crudCommon from '@/mixins/crud';
import loadingGlo from '@/util/loading'
import './util/rem'
import md5 from 'js-md5'
// require('./mock')
//.require('@/static/jquery.min.js')
// require('@/static/pageoffice.js')
// 注册全局crud驱动
window.$crudCommon = crudCommon;
// 加载Vue拓展
Vue.use(router);
Vue.use(VueAxios, axios);
Vue.use(Element, {
    i18n: (key, value) => i18n.t(key, value)
});
Vue.use(window.AVUE, {
    size: 'small',
    tableSize: 'small',
    calcHeight: 65,
    i18n: (key, value) => i18n.t(key, value)
});
// 注册全局容器
Vue.component('basicContainer', basicContainer);
Vue.component('myDrawer', myDrawer);
Vue.component('basicBlock', basicBlock);
Vue.component('thirdRegister', thirdRegister);
// 加载相关url地址
Object.keys(urls).forEach(key => {
    Vue.prototype[key] = urls[key];
});
// 加载website
Vue.prototype.website = website;
Vue.prototype.$md5 = md5;
// Vue.prototype.loadingGlo = loadingGlo;
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
    loadStyle(iconfontUrl.replace('$key', ele));
});

Vue.config.productionTip = false;

Vue.config.devtools = true;


new Vue({
    router,
    store,
    i18n,
    components: {
        nodeWrap,
        addNode,
    },
    render: h => h(App)
}).$mount('#app');
